faire disparaitre une partie d'un formulaire

<script type="text/javascript">
function cacherFormulaire(){
        document.getElementById("formulaire").style.display = "none"; 
}
</script>
 


<form action="" id="formulaire">
        <input type="button" value="Envoyer" onclick="cacherFormulaire()"/>
</form>
 
////////////////////////////////////////////////////// 
<div id="texte" class="texte">
pipo
</div>

<script type="text/javascript">
    //<!--
        afficher_cacher('texte');
    //-->
    </script>
	
function afficher_cacher(id)
{
    if(document.getElementById(id).style.visibility=="hidden")
    {
        document.getElementById(id).style.visibility="visible";
        document.getElementById('bouton_'+id).innerHTML='Cacher le texte';
    }
    else
    {
        document.getElementById(id).style.visibility="hidden";
        document.getElementById('bouton_'+id).innerHTML='Afficher le texte';
    }
    return true;
}


function toggle_visibility(id) {
		   var e = document.getElementById(id);
		   if(e.style.display == 'block')
			  e.style.display = 'none';
		   else
			  e.style.display = 'inline';
		}


<script type="text/javascript">
<!--// [CDATA[
    function divaffiche(){
      document.getElementById("popup").style.display = "block";
      document.getElementById("cache").style.display = "inline";
      document.getElementById("voir").style.display = "none";
    }
    function divcache(){
      document.getElementById("popup").style.display = "none";
      document.getElementById("cache").style.display = "none";
      document.getElementById("voir").style.display = "inline";
    }
 
// ]] -->
</script>
et le html qui va avec (hauteur et largeur donnée pour visualiser l'element vide).:
  <input type="button" id="voir" value="afficher le code." 
   onClick="divaffiche()" style="display:inline;"/>

  <input type="button" id="cache" value="cacher le code." 
   onClick="divcache()" style="display:none;"/>

  <div id="popup" style="display:none;height:5em;
   width:300px;margin:auto;border:solid;">
  </div>		